import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.ImageIcon;
import java.awt.Image;
import java.awt.Toolkit;
public class Main {


    public static class picture extends JFrame
    {
        ImageIcon icon=new ImageIcon();
        Image image=Toolkit.getDefaultToolkit().getImage("\"C:\\Users\\LIUYANJIAO\\Desktop\\壁纸\\Camera_XHS_1731159909619.jpg\"");

        picture()
        {//constructor
            this.setSize(400, 400);
            icon.setImage(image);
            JButton button = new JButton();
            button.setIcon(icon);

            this.getContentPane().add(button);
            this.setVisible(true);

        }
        //---------------------------------------------------
        public static void main(String[] args) {
            new picture();
        }
    }
}